/**
 * 
 */
package OOP_1;

/**
 * @Description
 * @author zych1108
 * @version
 * @date 2021年6月11日上午9:51:51
 */
public class Bank {
	private Customer[] customers;
	private int numberOfCustomer;
	
	public Bank() {
		customers = new Customer[10];
	}
	
	public void addCustomer(String f,String l) {
		Customer cust = new Customer(f, l);
		customers[numberOfCustomer++] = cust;
	}
	
	public int getNumOfCustomer() {
		return numberOfCustomer;
	}
	
	public Customer getCustomer(int index) {
		if(index < 0 || index > numberOfCustomer) {
			System.out.println("找不到索引位置");
			return null;
		}
		return customers[index];
		
	}
}
